<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // number --> Boolean(value)  0:false  非0：true
        // 
        var a = 0;
        var b = -1;
        var c = 20;
        console.log(Boolean(a))  // false
        console.log(Boolean(b))  // true
        console.log(Boolean(c))  // true

        // string --> Boolean(value)  空字符串""为:false
        var str = "hello world"
        var str1 = " "
        var str2 =""
        console.log(Boolean(str))  // true
        console.log(Boolean(str1)) // true
        console.log(Boolean(str2)) // false
    </script>
</body>
</html>